<?php
/**
 * Created by PhpStorm.
 * User: xuaxu
 * Date: 2019/7/20
 * Time: 16:37
 */

namespace App\Http\Controllers;


use Illuminate\Http\Request;
use App\Http\Model\Admin as AdminModel;

class AdminController extends Controller {
    //管理员;列表
    public function list() {
        //获取管理员的所有信息
        $AdminModel = new AdminModel();
        $admin_data = $AdminModel->getAdminList();
        return view('admin/list', compact('admin_data'));
    }

    //添加管理员
    public function store(Request $request) {

        if ($request->isMethod('post')) {
            //如果是添加的话
            $data = $request->all();
            $AdminModel = new AdminModel();
            $res = $AdminModel->getAdminStroe($data);
            return $res;
        }
        return view('admin/add');
    }

}